import Vue from "vue";
import VueRouter from "vue-router";
// 路由懒加载，用户看到哪个 就加载哪个组件
const login = () => import("@/components/Login.vue");
const home = () => import("@/components/home.vue");
const ss_data = () => import("@/components/ss_data.vue");
const query_pivot = () => import("@/components/query_pivot.vue");
const data_visualization = () => import("@/components/data_visualization.vue");
const monitoring = () => import("@/components/monitoring.vue");
const station_c = () => import("@/components/station_c.vue");
const setting = () => import("@/components/setting.vue");
Vue.use(VueRouter);

export default new VueRouter({
  routes: [
    { path: "/", redirect: "/login" },
    { path: "/login", component: login },
    {
      path: "/home",
      component: home,
      redirect: "/ss_data",
      children: [
        { path: "/ss_data", component: ss_data },
        { path: "/query_pivot", component: query_pivot },
        { path: "/query_pivot/:id", component: query_pivot },
        { path: "/data_visualization", component: data_visualization },
        { path: "/data_visualization/:id", component: data_visualization },
        { path: "/monitoring", component: monitoring },
        { path: "/station_c", component: station_c },
        { path: "/setting", component: setting }
      ]
    }
  ]
});
